#include<stdio.h>
#include<stdlib.h>
#include<filesystem>
using namespace std;
void save_in(){
    FILE *fw=fopen("./in.txt","wb");
    if(fw==NULL){
        printf("error");
        exit(1);
    }
    char c;
    bool flag=1;
    while('\n'!=(c=getchar())){
        if(c>='a'&&c<='z'||c>='A'&&c<='Z'){
            if(flag==1){
                fprintf(fw," ");
            }
            flag=0;
        }else{
            fprintf(fw,"%c",c);
            flag=1;
        }
    }
    fclose(fw);    
}
int main(){
    save_in();
    return 0;
}